/*
 * @Description: Circle
 * 
 * @Author: rendc
 * 
 * @Date: 2025-03-06 11:28:40
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2025-03-07 09:54:44
 */
public class Circle extends Shape {
  // 半径
  private int r;

  // 构造器
  public Circle() {
  }

  public Circle(String name, int r) {
    super(name);
    this.r = r;
  }

  // 继承了有抽象方法的父类，子类必须重写父类中所有的抽象方法
  @Override
  public double getArea() {
    return Math.PI * r * r;
  }
}